import layoutHeaderAside from '@/views/layout/header-aside'
import demos from '@/router/demo/test';
import frame from '@/router/modules/frame';
import workflow from '@/router/modules/workflow';
import zfcase from '@/router/modules/zfcase';
import system from '@/router/modules/system';
import doc from '@/router/demo/doc';

const meta = {requiresAuth: true};
/**
 * 在主框架内显示
 */
const frameIn = [
  {
    path: '/', meta, redirect: {name: 'index'}, component: layoutHeaderAside, children: [
      ...workflow,
      ...demos,
      ...zfcase,
      ...system,
      ...doc,
      ...frame
    ]
  },
]

/**
 * 在主框架之外显示
 */
const frameOut = [
  // 登录
  //登录页
  {path: '/login', name: 'login', component: () => import('@/views/login')}
]

/**
 * 错误页面
 */
const errorPage = [
  {path: '*', name: '404', redirect: {name: 'index'}}
]

// 导出需要显示菜单的
export const frameInRoutes = frameIn;

// 重新组织后导出
export default [
  ...frameIn,
  ...frameOut,
  ...errorPage,
]
